Make an initial stab at refactoring the mime type detection.
Adds magic header checks for the following types:
* MIDI
* Ogg
* PDF
* XCF
* DOS/Windows, Mach-O, and ELF executables
Locks down detection to prevent uploading different file types for the following extensions:
* mid, ogg, pdf, svg, wmf, xcf
This should now cover all the file types we have uploadable at Wikimedia public sites. (I've disabled the old StarOffice formats.)
Changed priority so our own checks happen in favor of the external checks, since we don't trust that stuff. Would like to see much further work here to replace it all.
Hopefully I haven't broken SVG files; I'm not 100% certain the built-in checks are correct.